
@using ViewComponentSample.Models
@model IEnumerable<TodoItem>


<h2>ToDo Starter</h2>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.IsDone)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Priority)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.IsDone)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Priority)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            </tr>
    }
  <!-- <snippet2> -->
</table>

<div>
    Maximum Priority: @ViewData["maxPriority"] <br />
    Is Complete:  @ViewData["isDone"]
    <!-- <snippet> -->
    @await Component.InvokeAsync("PriorityList",
                     new { 
                         maxPriority =  ViewData["maxPriority"],
                         isDone = ViewData["isDone"]  }
                     )
    <!-- </snippet> -->
</div>
  <!-- </snippet2> -->
